package cn.disignPattern.com.partThree;

public class Soy extends CondimentDecorator {

    Beverage beverage;

    public Soy(Beverage beverage){
        this.beverage = beverage;
    }

    @Override
    public String getDescription() {
        return beverage.getDescription()+",soy";
    }

    @Override
    public double cost() {
        Double cost = .20+beverage.cost();
        int size = getSize();
        if(size == Beverage.TALL){
            return cost + 0.1;
        }else if(size == Beverage.GRANDE){
            return cost + 0.2;
        }else {
            return cost + 0.3;
        }

    }

    public int getSize(){
        return beverage.getSize();
    }


}